<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>{:$i->title}</title>
<link href="{:$smarty.const.PUBLIC_DIR}/common/style/admin.css" rel="stylesheet" type="text/css" />
<style type="text/css">
th {text-align:right; width:75px;}
td {text-align:left;}
</style>
</head>
<body>
<div class="wrapper">
  <div class="title shadow titleBg">
    <table width="100%" border="0" cellspacing="1">
      <tr>
        <td><h1> {:$i->title} => {:if $i->p[0] eq "mod"}修改{:elseif $i->p[0] eq "add"}添加{:/if} </h1></td>
      </tr>
    </table>
  </div>
  <div class="content shadow">
    <form>
      <table width="100%" border="0" cellspacing="1">        
        <tr>
          <th nowrap="nowrap">广告名称：</th>
          <td><input name="name" type="text" id="name" value="{:$i->data->name}" size="30" class="posted check" /></td>
        </tr>
        <tr>
          <th nowrap="nowrap">广告期限：</th>
          <td>
          <select name="exp" id="exp" onchange="if(this.value == 1)$('#timeArea').show();else $('#timeArea').hide();" class="posted"><option value="0" {:if $i->data->exp == 0}selected="selected"{:/if}>永久有效</option><option value="1" {:if $i->data->exp == 1}selected="selected"{:/if}>设定时间</option></select>
        <span id="timeArea"{:if $i->data->exp == 0} class="hidden"{:/if}>
        <input value="{:$smarty.now|date_format:'%Y-%m-%d'} 00:00:00" name="startTime" id="startTime" size="18" class="posted" />  →  
        <input value="{:$smarty.now|date_format:'%Y-%m-%d'} 23:59:59" name="endTime" id="endTime" size="18" class="posted" />
         </span>
          </td>
        </tr>
        <tr>
          <th nowrap="nowrap">广告代码：</th>
          <td><textarea name="code" rows="5" id="code" class="posted check">{:$i->data->code}</textarea></td>
        </tr>
        <tr>
          <th nowrap="nowrap">过期内容：</th>
          <td><textarea name="expContent" rows="2" id="expContent" class="posted">{:$i->data->expContent}</textarea></td>
        </tr>
        <tr>
          <th nowrap="nowrap">&nbsp;</th>
          <td>
          <input type="submit" value=" 提 交 " />
            &nbsp;
            <input type="reset" onclick="history.go(-1);" value=" 返 回 " />          </td>
        </tr>
      </table>
    </form>
  </div>
</div>
<link href="{:$smarty.const.PUBLIC_DIR}/common/style/ui.all.css" rel="stylesheet" type="text/css" />
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/jquery-1.4.2.min.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/jquery.tools.min.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.core.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.draggable.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.dialog.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.datepicker.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/jquery.post.js"></script>
<script language="javascript" type="text/javascript">
$(document).ready(function(){
	$(".helpTip").tooltip().dynamic();
	$("form").post({
		sendUrl:'{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/{:if $i->p[0] eq "mod"}update/{:$i->p[1]}{:elseif $i->p[0] eq "add"}insert{:/if}',
		goUrl:'{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/lists'
	});
	$("#startTime").datepicker({ dateFormat: 'yy-mm-dd', minDate: '+0', changeMonth: true, changeYear: true,onSelect: function(dateText) { this.value += ' 00:00:00' }});
	$("#endTime").datepicker({ dateFormat: 'yy-mm-dd' , minDate: '+0', changeMonth: true, changeYear: true,onSelect: function(dateText) { this.value += ' 23:59:59' } });
});
</script>
</body>
</html>
